home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7108 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: nntp.uib.no!usenet
  2. From: ketil@ii.uib.no (Ketil Z Malde)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 20 Feb 1996 21:40:20 +0100
  6. Organization: II, UiB
  7. Sender: ketil@trost.ii.uib.no
  8. Message-ID: <eg3f85zq6j.fsf@trost.ii.uib.no>
  9. References: <00001a73+00002504@msn.com> <3114d8fb.5a455349@zesi.ruhr.de>
  10.     <4f5h5t$f13@vixen.cso.uiuc.edu> <4g1bgf$l5@mailhub.scitec.com.au>
  11.     <4g2vn3$rgi@dfw.dfw.net> <4g8ook$bce@mailhub.scitec.com.au>
  12.     <nelsoni.824704449@rintintin.Colorado.EDU>
  13. Reply-To: ketil@ii.uib.no
  14. NNTP-Posting-Host: trost.ii.uib.no
  15. X-Newsreader: September Gnus v0.38/XEmacs 19.13
  16.  
  17.  
  18. Since, as you say, these issues are religious, here's a little
  19. gospelling -- hope I don't miss the mark entirely:
  20.  
  21. Ian said:
  22.  
  23. For imparitive programming and in general:
  24.     *  C++ is not strong typed.  You can point a string to an integer
  25.        to a float and the most you'll usually get is a compiler warning.
  26.  
  27. Don't you need a cast to do this?!?
  28.  
  29.     *  C++ functions can be anywhere.  On more than one occasion I have
  30.        had to result to using "grep" on a large directory of files because
  31.        a programmer decided to just throw it in to a file for no obvious
  32.        reason.
  33.  
  34. This is, of course true.  Use [ce]tags, or some other scheme to
  35. navigate your source code.
  36.  
  37.     *  Ada makes it more clear on what parameters for functions (procedures
  38.        and functions) do and what happens to them.  It is not uncommon to
  39.        send a pointer to a function in C++ even though the function doesn't
  40.        change anything.
  41.  
  42. ..which is why you declare it as "const" (even though I know you can
  43. probably still fool it)
  44.  
  45.     *  Here is a good religious issue: C and C++ pick lousy names for the
  46.        standard library functions and classes.
  47.  
  48. Whatever.
  49.  
  50.     *  Ada is case insensitive.  C and C++ both care about the case you
  51.        use.
  52.  
  53. I care, too, so that suits me fine.  Matter of taste?
  54.  
  55.     *  There are stylistic differences. [...]
  56.     *  C++ templates and exceptions are a pretty new standard for the
  57.        language, until recently the compiler vendor decided how to handle 
  58.        them.  They aren't really in wide use yet.
  59.  
  60. Hmm...I think templates are coming along nicely, at least the STL
  61. seems to gain some foothold, don't you think?  Any compilers *still*
  62. not supporting templates?  I doubt it.
  63.  
  64.     *  C++ won't let you range types: a la "type year is an integer from
  65.        -2000 to 2050" or like that.
  66.  
  67. But you can easily write one yourself, and make your own choices when
  68. there's a tradeoff between flexibility and performance.
  69.  
  70.     *  C++ enums are still typically just integers, is this
  71.            changing?
  72.  
  73. I believe so -- though don't bet on it.
  74.  
  75.     *  C and C++ have macros, I don't think ada has a feature like
  76.            that.
  77.  
  78. I thought macros were bad?  Anyway, I think cpp adds some nice
  79. features every now and again.
  80.  
  81. [...]
  82.  
  83.     *  I think I like the emacs mode for ada more than the C++ mode that I
  84.        have.  
  85.     
  86. I do wish cc-mode would support highlighting template definitions as
  87. well, yes.
  88.  
  89. -kzm
  90.  
  91.